package ber.mcs;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class List extends ListActivity {

	
/** Called when the activity is first created. */

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		int i=0;
		// Create an array of Strings, that will be put to our ListActivity
		for(i=0;UDPAndroidActivity.filmes[i]!=null;i++ ){Log.d("TESTE",Float.toString(i));}
		String[] testes = new String[i];
		
		for(i=0;UDPAndroidActivity.filmes[i]!=null;i++ ){
			testes[i]=UDPAndroidActivity.filmes[i];
		}
			
		// Create an ArrayAdapter, that will actually make the Strings above
		// appear in the ListView
		this.setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, testes));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		// Get the item that was clicked
		Object o = this.getListAdapter().getItem(position);
		String keyword = o.toString();
		Toast.makeText(this, "You selected: " + keyword, Toast.LENGTH_LONG)
				.show();
	}
}